from appium.webdriver.common.mobileby import MobileBy

from base.base_page import BasePage
from pages.edit_member_page import EditMemberPage


class PersonalInfoPage(BasePage):
    _right_top_icon = (MobileBy.XPATH, "//*[@text='个人信息']/../../../../following-sibling::*")
    _edit_member_locator = (MobileBy.XPATH, "//*[@text='编辑成员']")

    def go_to_edit_member(self):
        self.find_and_click(self._right_top_icon)
        self.find_and_click(self._edit_member_locator)
        return EditMemberPage(self.driver)
